namespace CoverageRunner
{
    public class CoverageAnalyzer
    {
        public static void GetCodeCoverage(CodeCoverageParams codeCoverageParams)
        {
            var instrumentation = new VisualStudioInstrumentation(codeCoverageParams.VsTsInstrLocation);
            instrumentation.Instrument(codeCoverageParams.PathToCodeToInstrument, codeCoverageParams.AssembliesToInstrument);

            var testRunner = new UnitTestRunner(codeCoverageParams.UnitTestRunnerExecutable, codeCoverageParams.UnitTestArguments);
            var reportCreator = new CoverageReportCreator(codeCoverageParams.VstsCoverageOutputFile, codeCoverageParams.SymbolsPath, codeCoverageParams.ExePath, codeCoverageParams.OutputXml, codeCoverageParams.CoverageXslt, codeCoverageParams.OutputHtml);
            var coverageGenerator = new CoverageGenerator(codeCoverageParams.VstsCoverageOutputFile, testRunner, reportCreator);

            coverageGenerator.Execute();
        }
    }
}